$(document).ready(function(){
	$(".info_space").hide();
});

function clickButton(id, input){
	
	var info_space = "#" + $(input).attr('value');
	
	if ($(input).text() == "Show"){
		$(input).html("Hide");
		$(info_space).show("slow");
		
		if ($(info_space).text()==""){
			$(info_space).html("<img src='img/ajax-loader.gif'/>");
			$.getJSON("ajax_get_applicant.jsp", {"id": id}, function(data){
				$.get('application_template.htm', function(template){
					$(info_space).html($.tmpl(template, data));
				});
			});
		}
	}
	else{
		$(input).html("Show");
		//$(info_space).html("");
		$(info_space).hide("slow");
	}
}